package cn.edu.neusoft.practice.Controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.neusoft.practice.Service.user_roleService;
import cn.edu.neusoft.practice.mapper.user_roleMapper;
import cn.edu.neusoft.practice.po.user_role;


@Controller
public class user_roleController {

  @Autowired
  private user_roleMapper user_roleMapper;
  
  @RequestMapping("/getAlluser_role")
  @ResponseBody
  public List<user_role> getAlluser_role(){
    
     return user_roleMapper.selectList(null) ;
     
  }
  @RequestMapping("/updateuser_role")
     @ResponseBody
      public int updateuser_role(user_role r){
        return user_roleMapper.updateById(r);

      }
      @RequestMapping("/adduser_role")
      @ResponseBody
      public int adduser_role(user_role user_role){
        return user_roleMapper.insert(user_role);
      }

      @RequestMapping("/deleteuser_role")
      @ResponseBody
      public int deleuser_role(String user_roleId){
        return user_roleMapper.deleteById(user_roleId);
        
      }
}  